package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * Created by VegetaKo on 2017/2/11.
 */
@DynamicInsert
@Entity
@Table(name = "mall_order_price")
public class MallOrderPrice extends BaseEntity {
    public enum MallOrderPrice_{
        orderCode
    }
    private String orderCode;
    private String goodCode;
    private String priceCode;
    private BigDecimal point;
    private BigDecimal money;
    private Integer count;
    private BigDecimal totalPoint;
    private BigDecimal totalMoney;
    private String name;
    private String descript;
    private String descriptM;
    private String logo;
    private String pictures;

    @Basic
    @Column(name = "order_code", nullable = true, length = 16)
    public String getOrderCode() {
        return orderCode;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    @Basic
    @Column(name = "good_code", nullable = true, length = 16)
    public String getGoodCode() {
        return goodCode;
    }

    public void setGoodCode(String goodCode) {
        this.goodCode = goodCode;
    }

    @Basic
    @Column(name = "price_code", nullable = true, length = 16)
    public String getPriceCode() {
        return priceCode;
    }

    public void setPriceCode(String priceCode) {
        this.priceCode = priceCode;
    }

    @Basic
    @Column(name = "point", nullable = true, precision = 2)
    public BigDecimal getPoint() {
        return point;
    }

    public void setPoint(BigDecimal point) {
        this.point = point;
    }

    @Basic
    @Column(name = "money", nullable = true, precision = 2)
    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    @Basic
    @Column(name = "count", nullable = true)
    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    @Basic
    @Column(name = "total_point", nullable = true, precision = 2)
    public BigDecimal getTotalPoint() {
        return totalPoint;
    }

    public void setTotalPoint(BigDecimal totalPoint) {
        this.totalPoint = totalPoint;
    }

    @Basic
    @Column(name = "total_money", nullable = true, precision = 2)
    public BigDecimal getTotalMoney() {
        return totalMoney;
    }

    public void setTotalMoney(BigDecimal totalMoney) {
        this.totalMoney = totalMoney;
    }

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "descript")
    public String getDescript() {
        return descript;
    }

    public void setDescript(String descript) {
        this.descript = descript;
    }

    @Basic
    @Column(name = "descript_m")
    public String getDescriptM() {
        return descriptM;
    }

    public void setDescriptM(String descriptM) {
        this.descriptM = descriptM;
    }

    @Basic
    @Column(name = "logo")
    public String getLogo() {
        return logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }

    @Basic
    @Column(name = "pictures")
    public String getPictures() {
        return pictures;
    }

    public void setPictures(String pictures) {
        this.pictures = pictures;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MallOrderPrice that = (MallOrderPrice) o;

        if (orderCode != null ? !orderCode.equals(that.orderCode) : that.orderCode != null) return false;
        if (goodCode != null ? !goodCode.equals(that.goodCode) : that.goodCode != null) return false;
        if (priceCode != null ? !priceCode.equals(that.priceCode) : that.priceCode != null) return false;
        if (point != null ? !point.equals(that.point) : that.point != null) return false;
        if (money != null ? !money.equals(that.money) : that.money != null) return false;
        if (count != null ? !count.equals(that.count) : that.count != null) return false;
        if (totalPoint != null ? !totalPoint.equals(that.totalPoint) : that.totalPoint != null) return false;
        if (totalMoney != null ? !totalMoney.equals(that.totalMoney) : that.totalMoney != null) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (descript != null ? !descript.equals(that.descript) : that.descript != null) return false;
        if (descriptM != null ? !descriptM.equals(that.descriptM) : that.descriptM != null) return false;
        if (logo != null ? !logo.equals(that.logo) : that.logo != null) return false;
        return pictures != null ? pictures.equals(that.pictures) : that.pictures == null;
    }

    @Override
    public int hashCode() {
        int result = orderCode != null ? orderCode.hashCode() : 0;
        result = 31 * result + (goodCode != null ? goodCode.hashCode() : 0);
        result = 31 * result + (priceCode != null ? priceCode.hashCode() : 0);
        result = 31 * result + (point != null ? point.hashCode() : 0);
        result = 31 * result + (money != null ? money.hashCode() : 0);
        result = 31 * result + (count != null ? count.hashCode() : 0);
        result = 31 * result + (totalPoint != null ? totalPoint.hashCode() : 0);
        result = 31 * result + (totalMoney != null ? totalMoney.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (descript != null ? descript.hashCode() : 0);
        result = 31 * result + (descriptM != null ? descriptM.hashCode() : 0);
        result = 31 * result + (logo != null ? logo.hashCode() : 0);
        result = 31 * result + (pictures != null ? pictures.hashCode() : 0);
        return result;
    }
}
